home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Developer Kit / QuickTime 2.0 Developer Kit.iso / mac / MAC / Programming Stuff / Interfaces / CIncludes / Processes.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-11  |  5.2 KB  |  186 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        Processes.h
  3.  
  4.      Copyright:    © 1984-1994 by Apple Computer, Inc.
  5.                  All rights reserved.
  6.  
  7.      Version:    Universal Interfaces 2.0a3  ETO #16, MPW prerelease.  Friday, November 11, 1994. 
  8.  
  9.      Bugs?:        If you find a problem with this file, send the file and version
  10.                  information (from above) and the problem description to:
  11.  
  12.                      Internet:    apple.bugs@applelink.apple.com
  13.                      AppleLink:    APPLE.BUGS
  14.  
  15. */
  16.  
  17. #ifndef __PROCESSES__
  18. #define __PROCESSES__
  19.  
  20.  
  21. #ifndef __TYPES__
  22. #include <Types.h>
  23. #endif
  24. /*    #include <ConditionalMacros.h>                                */
  25.  
  26. #ifndef __EVENTS__
  27. #include <Events.h>
  28. #endif
  29. /*    #include <Quickdraw.h>                                        */
  30. /*        #include <MixedMode.h>                                    */
  31. /*        #include <QuickdrawText.h>                                */
  32. /*    #include <OSUtils.h>                                        */
  33. /*        #include <Memory.h>                                        */
  34.  
  35. #ifndef __FILES__
  36. #include <Files.h>
  37. #endif
  38.  
  39. #ifdef __cplusplus
  40. extern "C" {
  41. #endif
  42.  
  43. #if GENERATINGPOWERPC
  44. #pragma options align=mac68k
  45. #endif
  46.  
  47. #ifdef __CFM68K__
  48. #pragma lib_export on
  49. #endif
  50.  
  51. struct ProcessSerialNumber {
  52.     unsigned long                    highLongOfPSN;
  53.     unsigned long                    lowLongOfPSN;
  54. };
  55. typedef struct ProcessSerialNumber ProcessSerialNumber, *ProcessSerialNumberPtr;
  56.  
  57.  
  58. enum {
  59. /* Process identifier - Various reserved process serial numbers */
  60.     kNoProcess                    = 0,
  61.     kSystemProcess                = 1,
  62.     kCurrentProcess                = 2
  63. };
  64.  
  65. /* Definition of the parameter block passed to _Launch
  66.     Typedef and flags for launchControlFlags field */
  67. typedef unsigned short LaunchFlags;
  68.  
  69.  
  70. enum {
  71. /* Definition of the parameter block passed to _Launch */
  72.     launchContinue                = 0x4000,
  73.     launchNoFileFlags            = 0x0800,
  74.     launchUseMinimum            = 0x0400,
  75.     launchDontSwitch            = 0x0200,
  76.     launchAllow24Bit            = 0x0100,
  77.     launchInhibitDaemon            = 0x0080
  78. };
  79.  
  80. /* Format for first AppleEvent to pass to new process.  The size of the overall
  81.   buffer variable: the message body immediately follows the messageLength */
  82. struct AppParameters {
  83.     EventRecord                        theMsgEvent;
  84.     unsigned long                    eventRefCon;
  85.     unsigned long                    messageLength;
  86. };
  87. typedef struct AppParameters AppParameters, *AppParametersPtr;
  88.  
  89. /* Parameter block to _Launch */
  90. struct LaunchParamBlockRec {
  91.     unsigned long                    reserved1;
  92.     unsigned short                    reserved2;
  93.     unsigned short                    launchBlockID;
  94.     unsigned long                    launchEPBLength;
  95.     unsigned short                    launchFileFlags;
  96.     LaunchFlags                        launchControlFlags;
  97.     FSSpecPtr                        launchAppSpec;
  98.     ProcessSerialNumber                launchProcessSN;
  99.     unsigned long                    launchPreferredSize;
  100.     unsigned long                    launchMinimumSize;
  101.     unsigned long                    launchAvailableSize;
  102.     AppParametersPtr                launchAppParameters;
  103. };
  104. typedef struct LaunchParamBlockRec LaunchParamBlockRec, *LaunchPBPtr;
  105.  
  106. /* Set launchBlockID to extendedBlock to specify that extensions exist.
  107.  Set launchEPBLength to extendedBlockLen for compatibility.*/
  108.  
  109. enum {
  110.     extendedBlock                = ((unsigned)'LC'),
  111.     extendedBlockLen            = (sizeof(LaunchParamBlockRec) - 12)
  112. };
  113.  
  114. enum {
  115. /* Definition of the information block returned by GetProcessInformation */
  116.     modeDeskAccessory            = 0x00020000,
  117.     modeMultiLaunch                = 0x00010000,
  118.     modeNeedSuspendResume        = 0x00004000,
  119.     modeCanBackground            = 0x00001000,
  120.     modeDoesActivateOnFGSwitch    = 0x00000800,
  121.     modeOnlyBackground            = 0x00000400,
  122.     modeGetFrontClicks            = 0x00000200,
  123.     modeGetAppDiedMsg            = 0x00000100,
  124.     mode32BitCompatible            = 0x00000080,
  125.     modeHighLevelEventAware        = 0x00000040,
  126.     modeLocalAndRemoteHLEvents    = 0x00000020,
  127.     modeStationeryAware            = 0x00000010,
  128.     modeUseTextEditServices        = 0x00000008,
  129.     modeDisplayManagerAware        = 0x00000004
  130. };
  131.  
  132. /* Record returned by GetProcessInformation */
  133. struct ProcessInfoRec {
  134.     unsigned long                    processInfoLength;
  135.     StringPtr                        processName;
  136.     ProcessSerialNumber                processNumber;
  137.     unsigned long                    processType;
  138.     OSType                            processSignature;
  139.     unsigned long                    processMode;
  140.     Ptr                                processLocation;
  141.     unsigned long                    processSize;
  142.     unsigned long                    processFreeMem;
  143.     ProcessSerialNumber                processLauncher;
  144.     unsigned long                    processLaunchDate;
  145.     unsigned long                    processActiveTime;
  146.     FSSpecPtr                        processAppSpec;
  147. };
  148. typedef struct ProcessInfoRec ProcessInfoRec, *ProcessInfoRecPtr;
  149.  
  150.  
  151. #if !GENERATINGCFM
  152. #pragma parameter __D0 LaunchApplication(__A0)
  153. #endif
  154. extern pascal OSErr LaunchApplication(LaunchPBPtr LaunchParams)
  155.  ONEWORDINLINE(0xA9F2);
  156. extern pascal OSErr LaunchDeskAccessory(const FSSpec *pFileSpec, ConstStr255Param pDAName)
  157.  THREEWORDINLINE(0x3F3C, 0x0036, 0xA88F);
  158. extern pascal OSErr GetCurrentProcess(ProcessSerialNumber *PSN)
  159.  THREEWORDINLINE(0x3F3C, 0x0037, 0xA88F);
  160. extern pascal OSErr GetFrontProcess(ProcessSerialNumber *PSN)
  161.  FIVEWORDINLINE(0x70FF, 0x2F00, 0x3F3C, 0x0039, 0xA88F);
  162. extern pascal OSErr GetNextProcess(ProcessSerialNumber *PSN)
  163.  THREEWORDINLINE(0x3F3C, 0x0038, 0xA88F);
  164. extern pascal OSErr GetProcessInformation(const ProcessSerialNumber *PSN, ProcessInfoRec *info)
  165.  THREEWORDINLINE(0x3F3C, 0x003A, 0xA88F);
  166. extern pascal OSErr SetFrontProcess(const ProcessSerialNumber *PSN)
  167.  THREEWORDINLINE(0x3F3C, 0x003B, 0xA88F);
  168. extern pascal OSErr WakeUpProcess(const ProcessSerialNumber *PSN)
  169.  THREEWORDINLINE(0x3F3C, 0x003C, 0xA88F);
  170. extern pascal OSErr SameProcess(const ProcessSerialNumber *PSN1, const ProcessSerialNumber *PSN2, Boolean *result)
  171.  THREEWORDINLINE(0x3F3C, 0x003D, 0xA88F);
  172.  
  173. #ifdef __CFM68K__
  174. #pragma lib_export off
  175. #endif
  176.  
  177. #if GENERATINGPOWERPC
  178. #pragma options align=reset
  179. #endif
  180.  
  181. #ifdef __cplusplus
  182. }
  183. #endif
  184.  
  185. #endif /* __PROCESSES__ */
  186.